package com.java.mybatis.service.impl;

import com.java.mybatis.dao.LogisticsDao;
import com.java.mybatis.entity.Logistics;
import com.java.mybatis.service.LogisticsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * (Logistics)表服务实现类
 *
 * @author makejava
 * @since 2021-01-15 17:10:28
 */
@Service("logisticsService")
public class LogisticsServiceImpl implements LogisticsService {
    @Resource
    private LogisticsDao logisticsDao;
    /**
     * 牟恩跃----模糊查询
     * @param logisticsNumber
     * @return
     */
    @Override
    public List<Logistics> LogisticsLikeas(String logisticsNumber) {
        return this.logisticsDao.LogisticsLikeas(logisticsNumber);
    }

    /**
     * 牟恩跃----模糊查询
     * @param logisticsNumber
     * @return
     */
    @Override
    public List<Logistics> LogisticsLike(String logisticsNumber) {
        return this.logisticsDao.LogisticsLike(logisticsNumber);
    }

    /**
     * 牟恩跃--条件查询物流表数据
     * @param logistics
     * @return
     */
    @Override
    public List<Logistics> LogisticsAllas(Logistics logistics) {
        return this.logisticsDao.LogisticsAllas(logistics);
    }

    /**
     * 查询总数据的总条数
     * @param logisticsId
     * @return
     */
    @Override
    public int LogisticsAlls(Integer logisticsId) {
        return this.logisticsDao.LogisticsAlls(logisticsId);
    }

    /**
     * 查询所有物流表的数据数据
     * @param
     * @return
     */
    @Override
    public List<Logistics> LogisticsAll(Integer page,Integer pageSize) {
        return this.logisticsDao.LogisticsAll(page,pageSize);
    }

    /**
     * 通过ID查询单条数据
     *
     * @param logisticsId 主键
     * @return 实例对象
     */
    @Override
    public Logistics queryById(Integer logisticsId) {
        return this.logisticsDao.queryById(logisticsId);
    }

    /**
     * 查询多条数据
     *
     * @param offset 查询起始位置
     * @param limit 查询条数
     * @return 对象列表
     */
    @Override
    public List<Logistics> queryAllByLimit(int offset, int limit) {
        return this.logisticsDao.queryAllByLimit(offset, limit);
    }

    /**
     * 新增数据
     *
     * @param logistics 实例对象
     * @return 实例对象
     */
    @Override
    public Logistics insert(Logistics logistics) {
        this.logisticsDao.insert(logistics);
        return logistics;
    }

    /**
     * 修改数据
     *
     * @param logistics 实例对象
     * @return 实例对象
     */
    @Override
    public Logistics update(Logistics logistics) {
        this.logisticsDao.update(logistics);
        return this.queryById(logistics.getLogisticsId());
    }

    /**
     * 通过主键删除数据
     *
     * @param logisticsId 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer logisticsId) {
        return this.logisticsDao.deleteById(logisticsId) > 0;
    }

    /**
     * 查询最大id
     * @return
     */
    @Override
    public int queryByIdMaxLogistics(){
        return logisticsDao.queryByIdMaxLogistics();
    }

    /**
     * 添加
     * @param logistics
     * @return
     */
    @Override
    public int addLogistics(Logistics logistics){
        return logisticsDao.addLogistics(logistics);
    }


    /**
     * 查询所有物流的信息
     */
    @Override
    public List<Logistics> queryByLogistics(Integer page,Integer pageSize){
        return logisticsDao.queryByLogistics(page,pageSize);
    }

    /**
     * 查询总条数
     */
    @Override
    public int queryLogisticsCount(){
        return logisticsDao.queryLogisticsCount();
    }

    /**
     * 模糊查询
     */
    @Override
    public List<Logistics> queryLogisticsLikeLimit(Map<String,Object> map){
        return logisticsDao.queryLogisticsLikeLimit(map);
    }

    /**
     * 模糊查询总条数
     */
    @Override
    public int queryLogisticsLikeCount(Map<String,Object> map){
        return logisticsDao.queryLogisticsLikeCount(map);
    }
}